package cate.game.role.task.msg;

import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgOutput;
import cate.game.client.msg.id.MsgIdBTask;
import cate.game.role.task.TaskItem;
import easy.java.dev.note.NoteField;

import java.util.ArrayList;
import java.util.List;

@ClientMsg(title = "任务组数据更新 の 返回")
public class TaskGroupUpdateResp implements MsgOutput {

    @NoteField(value = "该任务组对应的功能ID")
    public int funcId;

    @NoteField(value = "改变的任务数据")
    public List<TaskItem> changes;

    public TaskGroupUpdateResp(){}

    public TaskGroupUpdateResp(int funcId, List<TaskItem> changes) {
        this.funcId = funcId;
        this.changes = changes;
    }

    public TaskGroupUpdateResp(TaskItem item) {
        this.funcId = item.funcId;
        this.changes = new ArrayList<>();
        this.changes.add(item);
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBTask.GROUP_UPDATE;
    }
}
